<?php 
//命名空间
namespace Home\Controller;
//导入类
use Think\Controller;

class AjaxController extends IndexController {
    public function index()
    {
    	if (!IS_AJAX) {
            $this->error('你是不是迷路了.....');
            exit;
        }
        $val = $_GET['name'];
        $list['name'] = array('like', "%$val%");
        $data = M('topic')->where($list)->select();
        $this->ajaxReturn($data);
    }
    public function container()
    {
        if (!IS_AJAX) {
            $this->error('你是不是迷路了.....');
            exit;
        }
        $val = $_GET['title'];
        $list['title'] = array('like', "%$val%");
        $data = M('container')->where($list)->select();
        $this->ajaxReturn($data);
    }
}